package code.starivan.niuke.jindian;

/**
 * Created by Ivan on 2015/8/28.
 */
public class ReverseString {
    public String reverseString(String iniString) {
        // write code here
        if(iniString==null||iniString.isEmpty()){
            return iniString;
        }

        char[] strArr=iniString.toCharArray();
        int i=0,j=strArr.length-1;
        while (i<j){
            char tmp=strArr[i];
            strArr[i]=strArr[j];
            strArr[j]=tmp;

            i++;
            j--;
        }

        return String.valueOf(strArr);
    }
}
